package com.yzt.base.utils;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;

import com.yzt.base.entity.BaseUser;

public class SecurityUtils {

	public static BaseUser getUser() {
		Authentication auth = SecurityContextHolder.getContext().getAuthentication();
		Object principal = auth.getPrincipal();
		if (principal instanceof BaseUser)
			return (BaseUser) principal;
		return null;
	}

}
